using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace FarseerPhysics.HelloWorld
{
    class CFileLogger : ILogger
    {
        string _filename;
        public CFileLogger(string filename)
        {
            _filename = filename;
            FileStream fs = new FileStream(_filename, FileMode.Create);
            fs.Close();
        }                             

        public override void Log(object who, string aStr)
        {
            StreamWriter sw = new StreamWriter(_filename, true, Encoding.Default);
            sw.Write(DateTime.Now + " : " + " " + who.ToString() + ":" + aStr + "\n");
            sw.Flush();
            sw.Close();
        }
    }
}
